%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Solução numerica das equações de Bloch,
%  n  = [n11,n22,Im(n12),Re(n12)] .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;

Ga=0;
Om=10;
De=10;
An=.5*pi*Om*Om;
T =[0:.01:1];

M =[	0			Ga			i/2*Om		-i/2*Om
		0			-Ga			-i/2*Om		i/2*Om
		i/2*Om		-i/2*Om		-Ga/2-i*De	0
		-i/2*Om		i/2*Om		0			-Ga/2+i*De];

n0=[0 1 0 0]';

for j=1:length(T)
	t=T(j);
	n=expm(M*t)*n0;
	nt1(j)=n(1);
	nt2(j)=n(2);
end

figure(1);
subplot(221),plot(T,nt1)

